package com.example.mapper;

import com.example.pojo.Transfer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vo.TransferVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyj
 * @since 2023-02-20
 */
public interface TransferMapper extends BaseMapper<Transfer> {

    @Select("select su.name userName,\n" +
            "su.phone phone,\n" +
            "t.*\n" +
            "from transfer t\n" +
            "left join sys_user su on t.oprate_user_id=su.id\n" +
            "where t.del_flag=0\n" +
            "and t.work_order_id=#{id}\n" +
            "order by t.update_date")
    List<TransferVo> queryByWorkOrderId(Long id);
}
